/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brain.cobranza.dto;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 *
 * @author Hvives
 */
@Entity
@Table(name = "TCOB_ASIG_CARTERA_CARGA")
public class AsigCarteraCargaDto implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_TCOB_ASIG_CARTERA_CARGA")
    @TableGenerator(name = "SEQ_TCOB_ASIG_CARTERA_CARGA", table = "TCORE_ENTIDAD", pkColumnName = "NOMBRE", valueColumnName = "CORRELATIVO", pkColumnValue = "TCOB_ASIG_CARTERA_CARGA", allocationSize = 1)
    private Long id;

    @JoinColumn(name = "ASIG_CARTERA", referencedColumnName = "ID")
    @ManyToOne
    private AsigCarteraDto asigCarteraDto;
    
    @JoinColumn(name = "CARGA_CLIENTE", referencedColumnName = "ID")
    @ManyToOne
    private CargaDto cargaClienteDto;

    public AsigCarteraCargaDto() {
    }

    public AsigCarteraCargaDto(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public AsigCarteraDto getAsigCarteraDto() {
        return asigCarteraDto;
    }

    public void setAsigCarteraDto(AsigCarteraDto asigCarteraDto) {
        this.asigCarteraDto = asigCarteraDto;
    }

    public CargaDto getCargaClienteDto() {
        return cargaClienteDto;
    }

    public void setCargaClienteDto(CargaDto cargaClienteDto) {
        this.cargaClienteDto = cargaClienteDto;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AsigCarteraCargaDto)) {
            return false;
        }
        AsigCarteraCargaDto other = (AsigCarteraCargaDto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.brain.cobranza.dto.AsigCarteraCargaDto[ id=" + id + " ]";
    }
}
